Release 10.1A: OpenEdge Development:
Java Open Clients
Getting meta data for OUTPUT TABLE and TABLE-HANDLE parameters
You can obtain schema information for a standard
ResultSetobject by accessing thejava.sql.ResultSetMetaDataobject returned by thegetMetaData()method on theResultSet. This ResultSetMetaData object allows you to access the schema information for each column in theResultSet.The
com.progress.open4gl.ProResultSetMetaDatainterface is an OpenEdge extension of thejava.sql.ResultSetMetaDatainterface. The extensions inProResultSetMetaDataaccess the schema information for theProResultSetobject viewed as temp-table fields, using the array model. To use these extensions, you must cast the ResultSetMetaData object returned fromgetMetaData()as aProResultSetMetaDataobject:
The rest of this section describes the
ProResultSetMetaDatamethods and how they allow you to view aProResultSetobject both as standardResultSetcolumns and temp-table fields, using the array model.Standard methods in the ProResultSetMetaData class
The
ProResultSetMetaDataclass has the following public methods:
- These methods are part of the standard
java.sql.ResultSetMetaDatainterface and are useful if the client wants to write standard code that could access any JDBCResultSet:
The
getColumnType()method returns anintconstant for the standard SQL types as shown in Table C–7. The SQL data type column in the table shows the type names as specified by thejava.sql.Typesclass:
The
getColumnTypeName()method returns the corresponding Progress data type names shown in Table C–7 under Progress data type.
ProResultSetMetaData class extension to java.sql.ResultSetMetaData
All the methods based directly on the standard
java.sql.ResultSetMetaDataclass view the temp-table using the standard SQL flat column model (columns without arrays)These methods all view the columns as fields with arrays:
- The following methods allow you to see the data type of each
ResultSetcolumn as Progress and Java types:
This returns one of the constant values accessible from
com.progress.open4gl.Parameter:
getColumnJavaTypeName()returns the name of the Java class to which each Progress data type maps. For information on these mappings, see Table C–1.For more information, see the information on specifying data type meta data for temp-tables in Chapter 4, " Passing Parameters."
- The following methods provide access to the schema of temp-table parameters that contain array fields, viewed from an OpenEdge viewpoint:
The Progress-oriented methods, which view the temp-table using the Progress array field model (fields that can include arrays), have prototypes that refer to
Fieldorfield. For more information on the relationship betweenResultSetcolumns and Progress array fields, see the "Accessing temp-table array fields" section.Although you can access the data using either the SQL or Progress model, both provide equivalent functionality. Table C–8 shows the correspondence between the
ProResultSetMetaDatamethods.
Table C–8: Comparing some array and flat model methods This method returns the same set of values ... As this method ...
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |